/*
 * @Author: Nick
 * @Date: 2021-06-03 10:29:07
 * @LastEditTime: 2021-06-04 18:49:36
 * @LastEditors: Nick
 * @Description: In User Settings Edit
 * @FilePath: /emotech-weapp/src/app.js
 */
import Taro from '@tarojs/taro'
import { Provider } from 'react-redux'
import { useEffect } from 'react'
import configStore from './store'
import './app.scss'

const store = configStore()

const App = ({ children }) => {
  useEffect(() => {
    store.dispatch({ type: 'SET_USER', userInfo: Taro.getStorageSync('userInfo') || null }) // TODO 需要注释掉
  }, [])
  return (
    <Provider store={store}>
      {children}
    </Provider>
  )
}

export default App